package com.orhon.smartcampus.modules.material.mm;


import java.util.List;

import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import com.orhon.smartcampus.modules.base.mm.LangMapper;
import com.orhon.smartcampus.modules.base.mm.SchoolMapper;
import com.orhon.smartcampus.modules.material.entity.Floor;
import com.orhon.smartcampus.modules.material.gqlModel.GQLFloor;

@Mapper(
        uses = {
                LangMapper.class,
                UnitMapper.class,
                SchoolMapper.class
        }
)
public interface FloorMapper {


    FloorMapper MAPPER = Mappers.getMapper(FloorMapper.class);


    @Mapping(source = "id" , target = "id")
    @Mapping(source = "floorCode" , target = "code")
    @Mapping(source = "floorTel" , target = "tel")
    @Mapping(source = "floorManager" , target = "manager")
    @Mapping(source = "floorName" , target = "name")
    @Mapping(ignore = true, target = "unit" )
    @Mapping(ignore = true, target = "school" )
    @Mapping(source = "createdAt" , target = "created_at")
    @Mapping(source = "updatedAt" , target = "updated_at")
    GQLFloor toFloor(Floor entity);
    
    @InheritConfiguration(name = "toFloor")
    List<GQLFloor> toFloorList(List<Floor> entities);
}
